package listbyorder.access401_500.test459;

/**
 * @author code_yc
 * @version 1.0
 * @date 2020/8/24 15:29
 */
public class Solution1 {

    public boolean repeatedSubstringPattern(String s) {
        int n = s.length();
        if (n == 1) return false;
        for (int i = 1; i < n; i++) {
            if (n % i == 0) {
                String pre = s.substring(0, i);
                int l = n / i;
                boolean f = true;
                for (int j = 1; j < l; j++) {
                    String cur = s.substring(j * i, (j + 1) * i);
                    if (!pre.equals(cur)) {
                        f = false;
                        break;
                    }
                }
                if (f) return true;
            }
        }
        return false;
    }
}
